<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="box"></div>
    <div class="box"></div>
    <h2 class="box"></h2>
    <p class="box"></p>
    <a href="">东软睿道</a>
    <a href="">东软睿道</a>
    <a href="">东软睿道</a>
    <script>
        // DOM 操作
        let oBox = document.getElementById("box");
        oBox.style.width = "100px";
        oBox.style.height = "100px";
        oBox.style.background = "red";

        let aBox = document.getElementsByClassName("box");
        aBox[0].style.width = "100px";
        aBox[0].style.height = "100px";
        aBox[0].style.background = "yellow";

        aBox[1].style.width = "100px";
        aBox[1].style.height = "100px";
        aBox[1].style.background = "green";


        aBox[2].style.width = "100px";
        aBox[2].style.height = "100px";
        aBox[2].style.background = "red";

        let aA = document.getElementsByTagName("a");
        aA[0].style.color = "red";
        aA[1].style.color = "green";
        aA[2].style.color = "blue";

        // 定义变量
        var num = 100;
        var str = "hello";
        var bool = true;
        var date = new Date();
        // ES6 以后
        let num1 = 100;
        let str1 = "hello";
        const num2 = 100;
    </script>
</body>
</html>